/*
 * pyy Inc.
 * Copyright (c) 2019 All Rights Reserved.
 * create by pengyangyan
 * date:2019-02-28
 */
package com.cqjtu.platform.service.impl;

import org.springframework.stereotype.Service;

import com.cqjtu.platform.service.UserService;
import com.cqjtu.platform.dao.UserDao;
import com.cqjtu.platform.entity.User;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * User Service实现
 *
 * @author pengyangyan
 * Date: 2019-02-28 11:15:59
 */
@Service
public class UserServiceImpl extends BaseServiceImpl<User,UserDao> implements UserService {

    @Override
    public User findByAccount(String account) {
        Example example = new Example(User.class);
        example.createCriteria().andEqualTo("account",account);
        List<User> users = this.entityDao.selectByExample(example);
        if (users.size()==0){
            return null;
        }
        return users.get(0);
    }
}
